﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using WPF_Dialogs;
using WPF_Dialogs.Dialogs;

namespace WPF_Dialog_Sample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            FolderBrowseDialog f = new FolderBrowseDialog();
            //f.InitialPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            f.showDialog();
            this.labelFolderBrowse.Content = f.SelectedPath;
        }

        private void buttonFolderBrowserWithSelectedPath_Click(object sender, RoutedEventArgs e)
        {
            if (this.labelFolderBrowse.Content.ToString() == "")
                this.labelFDBWithSelecedPath.Content = "No Path selected";
            else
            {
                FolderBrowseDialog f = new FolderBrowseDialog();
                f.SelectedPath = this.labelFolderBrowse.Content.ToString();
                f.showDialog();
                this.labelFDBWithSelecedPath.Content = f.SelectedPath;
            }
        }

        private void buttonFolderBrowseDialogWithDepth_Click(object sender, RoutedEventArgs e)
        {
            FolderBrowseDialog f = new FolderBrowseDialog();
            f.InitialPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            f.TreeDepth = 3;
            f.showDialog();
            this.labelFDBWithDepth.Content = f.SelectedPath;
        }

        private void buttonSaveDialog_Click(object sender, RoutedEventArgs e)
        {
            SaveDialog sd = new SaveDialog();
            EDialogResult dr = sd.showDialog();
            if (dr == EDialogResult.Yes)
                this.labelSaveDialog.Content = "Yes";
            else if (dr == EDialogResult.No)
                this.labelSaveDialog.Content = "No";
            else
                this.labelSaveDialog.Content = "Cancel";
        }
    }
}
